#include "mq2_device.h"
#include <string.h>


static int MQ2DeviceInit(struct mQ2Dev *pMQ2Dev)
{
   MQ2_ADC_Init();
   return PDSUCCESS;
}


static int MQ2Device_GetValue(struct mQ2Dev *pMQ2Dev, uint32_t *pData, uint32_t Length)
{
    MQ2_ADC_GetValue(pData, Length);
    return PDSUCCESS;
}


static mQ2Dev  MQ2Devices ={
    .name = "MQ2",
    .Init = MQ2DeviceInit,
    .GetValue = MQ2Device_GetValue
};


pMQ2Dev GetMQ2Device(char *name)
{
    if(strcmp(name, "MQ2") == 0)
    {
        return &MQ2Devices;
    }
    return NULL;
}

